﻿using Blog.Application.Blogs;
using Blog.Application.Contract.Blogs;
using Blog.Application.Contract.User;
using Blog.Application.User;
using Blog.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;

namespace Blog.Application
{
    public static class BlogApplicationExtension
    {
        public static void AddApplication(this IServiceCollection services)
        {
            services.AddAutoMapper(typeof(BlogApplicationExtension));

            // 注入user服务
            services.AddTransient<IUserServer, UserServer>();
            /// 注入博客服务
            services.AddTransient<IBlogServer, BlogServer>();
            // 注入博客类型服务
            services.AddTransient<IBlogTypeService, BlogTypeService>();

            // 注入封装的EfCore服务
            services.AddEntityFrameworkCore();
        }



    }
}
